# -*- encoding: utf-8 -*-
"""
    Created by Rachel on 2025/03/06
"""
from flask import Flask

from applications.ext import PluginRegistry
from applications.libs.db import ModelRegister


class App(Flask):
    def __init__(self):
        super().__init__(__name__)
        self.init_setting()
        self.plugins = PluginRegistry(self)
        self.model_register()
        self.register_blueprints()

    def init_setting(self):
        self.config.from_object("applications.settings.config")
        self.config.from_object("applications.settings.secure")

    def register_blueprints(self):
        from applications.api import RegisterBlueprint

        RegisterBlueprint(self)

    def model_register(self):
        ModelRegister(self)